package com.llh.designpatterns.singleton.lazy;

/**
 * <h2>SingletonDemo02</h2>
 * <p>测试类</p>
 * <p>CreatedAt: 2019-11-23 19:44</p>
 * <p><a href="mailto:forever2y_y@163.com">SendMailToMe</a></p>
 *
 * @author llh
 */
class SingletonDemo02 {

    public static void main(String[] args) {
        test01();
        test02();
        test03();
        test04();
    }

    private static void test01() {
        Singleton01 instance = Singleton01.getInstance();
        Singleton01 instance2 = Singleton01.getInstance();
        System.out.println(instance == instance2);
    }

    private static void test02() {
        Singleton02 instance = Singleton02.getInstance();
        Singleton02 instance2 = Singleton02.getInstance();
        System.out.println(instance == instance2);
    }

    private static void test03() {
        Singleton03 instance = Singleton03.getInstance();
        Singleton03 instance2 = Singleton03.getInstance();
        System.out.println(instance == instance2);
    }

    private static void test04() {
        Singleton04 instance = Singleton04.getInstance();
        Singleton04 instance2 = Singleton04.getInstance();
        System.out.println(instance == instance2);
    }


}

